<template>
  <el-button type="info" class="add_btn type_info" @click="goInstall">点击授权(上架前)</el-button>
</template>

<script setup lang="ts">
  import domain from '@/utils/domain'
  import { installLink } from '@/api/app'
  import { useRoute } from 'vue-router'
  const route = useRoute()

  const goInstall = () => {
    const param = {
      redirectUri: `${domain.SITE_URL}/callback/weiwork/install`,
      state: {
        from: route.path
      }
    }
    installLink(param).then((data: any) => {
      window.location.href = data.link
    })
  }

  // 获取应用授权二维码
  // getAppQrCode(param).then((data: any)=>{
  //
  // })
</script>
